package Io;

import java.io.FileNotFoundException;
import java.io.PrintWriter;
/**
 * 缓冲字符流
 * java.io.BufferedWriter和BufferedReader
 * 缓冲字符流可以块读写文本数据加速.
 *
 * java.io.PrintWriter是具有自动行刷新的缓冲字符输出流.内部总是连接BufferedWriter
 * 特点:
 * 1:可以按行写出字符串
 * 2:自动行刷新
 */
public class PWDemo {
    public static void main(String[] args) throws FileNotFoundException {
        PrintWriter pw = new PrintWriter("pw.txt");
        pw.println("从南到北");
        pw.println("从北到南");
        System.out.println("写入完毕");
        pw.close();
    }
}
